Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision M+ support #461

Merged
merged 31 commits into from
Jan 8, 2024
Merged

Revision M+ support #461

merged 31 commits into from
Jan 8, 2024

Conversation

calc84maniac
Copy link
Contributor

@calc84maniac calc84maniac commented Mar 18, 2023

Makes the following changes to support new hardware on rev M+ and lay groundwork for future Python support and LCD improvements:

  • Added serial Flash chip support (commands used by the OS are supported)
  • Added Flash cache support with appropriate wait states
  • Fixed some aspects of parallel Flash support, like resetting it properly to avoid unrecoverable state when misconfigured
  • Improved SPI emulation and added UART emulation, both with accurate transfer timing, loopback support, and FIFO/interrupt behavior
  • Added SPI chip select support (allows deselecting the LCD on Python editions)
  • Added basic support for interlaced scan and MCU/VSYNC display modes (inaccurate timing but should display all pixels now)
  • Revision selection in settings rather than previously scattered options like IM 2 enable
  • Automatic revision selection based on the detected boot code version, also restricts usable revisions unless a debug option is set
  • Automatic Python edition detection based on the certificate, can be overridden with the same debug option
  • Flash statistics (average cycles per access and number of cache misses) added to debug cycle counting view

@calc84maniac
Copy link
Contributor Author

I've discovered an unusual bug in rev M emulation, which I think is a blocker on this PR.

Basically, the issue is that if you turn off the calculator while emulating rev M, linking stops working. This issue persists through resets and state saves/loads, and even when resetting into another revision. The only way to restore linking is to reload the ROM.

I did a git bisect, and found that this issue exists even back in @jacobly0's first commit, which leads me to believe it's something related to different code paths (in the boot code?) executed on rev M. But I don't understand why the problem persists through resets and other revisions. Perhaps there's some USB register that's never getting reset? I would appreciate if an expert on linking could look into this issue.

@calc84maniac
Copy link
Contributor Author

Finally fixed the outstanding USB issue, last call for reviews / sanity testing

@adriweb
Copy link
Member

adriweb commented Jan 8, 2024

@calc84maniac said it's ready and people have tested it without issues so far, let's merge :)

@adriweb adriweb merged commit dd34079 into master Jan 8, 2024
5 checks passed
@adriweb adriweb deleted the feature/rev_m branch January 8, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants